---------------------------------------------------------------------------------------
<template lang="jade">
div.ct_list_top
	table
		tr
			th(v-for='obj in headers',:style="'width:' + obj.width") {{ obj.name }}
		slot

</template>
---------------------------------------------------------------------------------------
<script>
import _ from 'lodash'
export default {
	props: {
		data: {
			type: String,
			required: true
		}
	},
	computed: {
		headers () {
			let result = []
			let objects = _.split(this.data, ',')
			// resuit = objects
			for (let obj of objects) {
				let tmp = _.split(obj.trim(), ':')
				// if (tmp.length == 1) {
				// 	tmp[1] = 'auto'
				// } else {
				// 	tmp[1] = tmp[1] + '%'
				// }
				let o = {
					name: tmp[0],
					// width: tmp[1]
				}
				result.push(o)
			}
			return result
		}
	}
}
</script>
---------------------------------------------------------------------------------------------------
<style lang="less" scoped>
@import "../../../plugin/style/mixin";

// 数据头部
.ct_list_top{ .w(100%); .bk(#fff); .mb(10); .ptb(5); .btbsol(#cdcdcd, 1);
	table { .w(100%); }
	th,td { .lh(20); }
	td { .tc(); }
}

</style>
